home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / termutil.0 / termutil / termutils-2.0 / fspec.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-11-30  |  1.1 KB  |  42 lines

  1. #!/bin/sh
  2. # build fspec.c from fspec.def
  3. # Copyright (C) 1995 Free Software Foundation, Inc.
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15.  
  16. : ${1?}
  17.  
  18. echo '/* Generated automatically from fspec.defs.  DO NOT EDIT. */
  19.  
  20. #include <tabs.h>
  21. '
  22.  
  23. sed -n    -e '/^#/d' \
  24. -e '/^[     ]*$/d' \
  25. -e 's+^\([^    ]*\).\([^    ]*\).*+static int t_\1[] = {\2,0};+p' \
  26. "$1"
  27.  
  28. echo '
  29. struct fspec_table fspec_table[] = {'
  30.  
  31. sed -n    -e '/^#/d' \
  32. -e '/^[     ]*$/d' \
  33. -e 's+^\([^    ]*\).\([^    ]*\).\(.*\)$+  {"\1", t_\1, "\3"},+p' \
  34. "$1"
  35.  
  36. echo '  {0, 0}
  37. };'
  38. exit 0
  39.